/**
* @file Application.cpp
* @Description: 这是QApplication的一个派生类主要是为了设定软件的各种信息。
* @Date: 2020-02-26
* @LastEditTime: 2020-02-26
* @LastEditors: twosilly
* @Author: twosilly
* @E-Mail:twosilly@foxmail.com
*/

#include "Application.h"
QString Application::m_appName = "UPRISE3D";
QString Application::m_organization = "uprise3d";
QString Application::m_organizationHost = "http://www.uprise3d.com/";
QString Application::m_webSite = "http://www.uprise3d.com/";
QString Application::m_downloadSite = "http://www.uprise3d.com/";

bool Application::notify(QObject * rec, QEvent * ev)
{
	try
	{
		return QApplication::notify(rec, ev);
	}
	//catch (MLEXception& e)
	//{
	//	qCritical("%s",e.what());
	//	abort();
	//}
	//catch (vcg::MissingComponentException &e)
	//{
	//	qCritical("%s",e.what());
	//	abort();
	//}
	catch (...)
	{
		//!真的很糟糕
		qCritical("Somwthing really bad happened!!!!!!");
		abort();
	}
	return false;
}

const QString Application::appVer()
{
	const QDate dt = QDate::currentDate();
	return QString::number(dt.year()) + "." + QString::number(dt.month());
}

const QString Application::completeName(const HW_ARCHITECTURE hw)
{
	return appArchitecturalName(hw) + " v" + appVer();
}
